Skip to content

[None][test] Cut the pre-merge CI time of the indexer Top-K unit tests - #23155

Open
longcheng-nv wants to merge 2 commits into
NVIDIA:mainfrom
longcheng-nv:user/loncheng/slim-indexer-topk-premerge
Open

longcheng-nv wants to merge 2 commits into
NVIDIA:mainfrom
longcheng-nv:user/loncheng/slim-indexer-topk-premerge

Conversation

@longcheng-nv

@longcheng-nv longcheng-nv commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • tests/unittest/conftest.py marks cases outside PRE_MERGE_CELLS as post_merge before pytest selection. Unconfigured modules and non-parametrized items stay selected. Confirm that a parameter rename does not silently drop cases from the pre-merge selection.
  • _stage_unittest_markexpr in tests/integration/defs/test_unittests.py appends not post_merge to stages whose names lack "Post-Merge". Confirm that existing mark expressions keep their meaning when combined with not post_merge.
  • The GVR and prefill oracles move from per-row checks to batched tensor checks. _check_prefill_exact skips score-selection checks on rows with in-window NaNs and checks only structure on those rows. This weakens the oracle for those rows.
  • l0_gb300.yml removes both files from the pre-merge parallel-kernel entry. Their full grids run only post-merge on GB300.
  • Pass counts and timings come from the PR author. The PR pipeline result was UNSTABLE, which the PR description attributes to the ci: full pre-merge approved label gate. No completed post-merge result is established from the supplied evidence.

QA Engineer Review

  • Test files changed:
    • tests/unittest/_torch/kernels/parallel/test_gvr_selfsampling_topk.py: adds PRE_MERGE_CELLS, _fp32_and, and batched checks.
    • tests/unittest/_torch/kernels/parallel/test_indexer_topk.py: adds PRE_MERGE_CELLS.
    • tests/unittest/tools/test_unittest_culprits.py: adds test_stage_unittest_markexpr_keeps_post_merge_tests_out_of_pre_merge_stages, parameterized over mark expressions and stage names.
  • Test-list files changed:
    • l0_b200.yml: adds both files with -m post_merge and a 90-minute timeout.
    • l0_h100.yml: adds the GVR file with post_merge selection and a 90-minute timeout.
    • l0_gb300.yml: removes both files from the parallel-kernel entry.
  • Covered behavior: fp32 Top-K cases for K = 512, 1024, and 2048; 16-bit, alternate-runner, and non-default-policy smoke cases; varlen, wide, and prefill checks.
  • Coverage verdict: needs follow-up. Multi-GPU stages need the approval label. No completed B200 or H100 post-merge run is established from the supplied evidence.

Per-File QA Perspective

  • tests/integration/defs/test_unittests.py: verify that stages without "Post-Merge" in their names run no post_merge tests.
  • tests/integration/test_lists/test-db/l0_b200.yml: verify that both files run in the post-merge B200 stages.
  • tests/integration/test_lists/test-db/l0_h100.yml: verify that GVR post_merge cases run on SM90.
  • tests/integration/test_lists/test-db/l0_gb300.yml: verify that GB300 pre-merge no longer runs these files.
  • tests/unittest/_torch/kernels/parallel/test_gvr_selfsampling_topk.py: verify that batched checks still detect wrong indices and values.
  • tests/unittest/_torch/kernels/parallel/test_indexer_topk.py: verify that pre-merge cells cover the listed fp32 K values.
  • tests/unittest/conftest.py: verify that post_merge marking applies only to configured modules.
  • tests/unittest/tools/test_unittest_culprits.py: run the new parameterized test with its listed inputs.

Description

tests/unittest/_torch/kernels/parallel/test_indexer_topk.py and test_gvr_selfsampling_topk.py are in the top 1% of pre-merge test time: in the week of 2026-11-09 they cost 377.5 and 312.0 GPU-weighted hours (L0_MergeRequest, test-case durations weighted by the GPU count of the stage), 1.41% of all pre-merge test time. This PR keeps pre-merge on the cases that guard production paths and runs every other case of each grid post-merge. No case is deleted.

Where the time went:

  • Both files run in four pre-merge stages per pipeline. The GB300 stage is a 4-GPU node, so its single-GPU runs count 4x: 255 of the 689 hours, while B300 already runs the same SM103 kernels in pre-merge.
  • Full-factorial grids: 2,409 cases per stage, crossing batch sizes inside one occupancy class, N inside one power-of-two bucket, data patterns and dtypes with every K and next_n.
  • Most of the time went to paths production does not take: the CuTe DSL entry points with no caller outside tests (cute_dsl_topk_decode_blackwell, cute_dsl_topk_decode_multi_cta_blackwell) and the single-pass mode-2 runners alone took 39% of test_indexer_topk.py.
  • The GVR oracles looped over rows in Python with host syncs per row; tests using them took 64% of test_gvr_selfsampling_topk.py.

Changes:

  1. Pre-merge cells, full grids post-merge. A test module may declare PRE_MERGE_CELLS, a dict from a test function to the parameter cells pre-merge keeps (or a predicate). tests/unittest/conftest.py marks every other parametrized case of those functions post_merge (already registered in tests/unittest/pytest.ini). tests/integration/defs/test_unittests.py appends and not post_merge to the unittest mark expression of every stage whose name lacks Post-Merge (the rule getMakoArgsFromStageName uses). Test-list entry text, the agg_unit_mem_df.csv worker lookup and waives are unchanged.

  2. Cells anchored on production paths. The model paths pass fp32 scores. Callers of these ops and their K:

    • DeepSeek-V3.2 (K 2048) and DeepSeek-V4 Flash and Pro (K 512 and 1024, compress ratio 4), through the DSA indexer: CUDA radix by default, GVR with enable_heuristic_topk on SM100/103, CuTe DSL radix with use_cute_dsl_topk.
    • DeepSeek-V4.1 Flash (K 512), GLM-5.3 (K 2048), GLM-5.3 Flash (K 512) and Kimi-K3.1 (K 2048).
    • GLM-5.2 (K 2048) and the experimental Qwen4 QSA path (K 512 and 2048).
    • RocketKV prefill and TriAttention, with K set by a configurable budget (RocketKV defaults to 2048). Other budgets rely on the odd and high-K smoke cells pre-merge and on the full grids post-merge.

    The kept cells cover each K in {512, 1024, 2048}, compress ratio 1 and 4, every N bucket the grids test (up to 262,144 columns), rows on both sides of the SM count, next_n > 1, the deterministic and MTP variants, and the gate and routing edges; data patterns rotate across shapes instead of crossing them. Entry points without a production caller, odd or above-2048 K, decode overflow policies other than REREAD, and the bf16/fp16 score paths keep one to four smoke cells each. The CUDA indexer_topk_decode/indexer_topk_prefill grids (0.07 s per case) stay whole.

  3. GB300 pre-merge drops the two files. l0_gb300.yml adds --ignore for both to its kernels/parallel entry (--ignore does not change the CSV key). The full grids keep running post-merge on SM103 (GB300, l0_gb300_multi_gpus.yml) and SM100 (two new -m post_merge entries in l0_b200.yml, with 8-worker rows in agg_unit_mem_df.csv); GR100 (SM107, l0_gr100.yml) post-merge keeps running the full test_gvr_selfsampling_topk.py, as before.

  4. Vectorized GVR oracles. _check_prefill_exact, _check_exact, _check_wide, _run_varlen_case (now _check_varlen_rows), _reference_varlen_indices and the poison loop of _make_prefill_case keep their assertions as batched tensor checks with one sync each.

  5. SM90 post-merge entry for the GVR file. main's H100 pre-merge stage runs all of test_gvr_selfsampling_topk.py (1,012 of 1,013 cases pass on SM90). H100 pre-merge now keeps the 269 cells, so the l0_h100.yml post-merge block gets a -m post_merge entry for the other 744, with an 8-worker row in agg_unit_mem_df.csv. test_indexer_topk.py needs none: its cases outside the cells skip on SM90.

Pre-merge per stage: test_indexer_topk.py 1,396 -> 318 cases, test_gvr_selfsampling_topk.py 1,013 -> 269 cases. Deliberately dropped from pre-merge (still post-merge): crosses of data patterns with shapes, extra batch sizes and N values inside one dispatch class, the full grids of the non-production entry points and dtypes.

Test Coverage

CI. The first CI run of this branch (L0_MergeRequest_PR #73458 on 2ab28fe) passed every CPU and single-GPU stage with 0 failed tests (164,978 passed, 15,810 skipped). It shows UNSTABLE only because the multi-GPU stages, GB300 included, wait for the ci: full pre-merge approved label. Test time of the two files per stage run, main -> this PR, where main is the median of its pre-merge runs from 2026-11-24 to 2026-12-01 (about 570 to 600 runs per single-GPU stage, 152 on GB300):

Stage test_indexer_topk.py test_gvr_selfsampling_topk.py Both files
DGX_B200-PyTorch-8 820 -> 185 s 915 -> 428 s 1,735 -> 612 s (35%)
DGX_B300-PyTorch-4 708 -> 91 s 643 -> 228 s 1,351 -> 318 s (24%)
DGX_H100-PyTorch-5 10 -> 10 s 366 -> 198 s 376 -> 208 s (55%)
Single-GPU stages per pipeline 3,463 -> 1,138 s (33%)
GB300-4_GPUs-PyTorch (weight 4) 757 s -> not run 755 s -> not run 1,512 -> 0 s
  • Each pre-merge stage ran the 587 kept cases. B200 and B300: 582 passed, 5 skipped (the Hopper-only GVR tests, as in the lab runs). H100: 491 passed, 96 skipped (the Blackwell-only CuTe DSL tests and one SM103 test).
  • The new B200 post-merge entries (DGX_B200-PyTorch-Post-Merge-1/-2) ran all 1,822 post-merge cases (1,078 + 744), all passed, in about 2.5 minutes of wall time per entry.
  • The second commit adds the SM90 post-merge entry. On main's H100 pre-merge, its 744 cases took about 175 s per run. Its CI run, with the H100 post-merge stages, is pending.
  • Weekly cost, rescaling the week of 2026-11-09 stage by stage with the per-file ratios above: 689.4 -> 140.1 GPU-weighted hours (20%, under the 50% target), before the SM90 post-merge entry, which adds well under 1 h a week. The savings: 255.1 h from GB300 pre-merge, 141.7 h on B200, 150.4 h on B300 and 6.2 h on the DGX_B300 and H100 stages; the new B200 post-merge entries add back 4.1 h at about 10 PR-triggered post-merge runs a week. The lab ratios below projected 110.6 h (16%).
  • H100 has run the GVR tests pre-merge since the following week (366 s per run on main); this PR cuts that to 198 s, a saving the 140.1 h figure leaves out.

Lab reproduction on one B200 with the main post-merge wheel of d29d9b9 (tensorrt_llm 1.4.0rc5) plus this branch's tests and the GVR host modules from main, CI flags (-n 8, --timeout=2400), a fresh CuTe DSL cache per run:

Per run on one B200 Before (main) After (this PR)
Cases 2,409 587
Total test time, test_indexer_topk.py 778 s 149 s (19%)
Total test time, test_gvr_selfsampling_topk.py 1,188 s 293 s (25%)
Total test time (execution work) 2,083 s 442 s (21%)
Slowest xdist shard 309 s 72 s (23%)
Wall time 378 s 140 s (37%)

Medians of 3 baseline runs and 2 runs of this branch on the same GPU, run alternately.

  • Every case still runs and passes: the pre-merge selection (587 cases) passed in all 3 runs (582 passed; the same 5 cases skip on B200 by their own guards as on main), and the post-merge selection (-m post_merge, 1,822 cases) passed in both runs.
  • The vectorized GVR oracles give the same verdicts as the per-row ones on 129 checks: reference outputs and corrupted outputs (duplicates, out-of-window indices, -1 inside the head, wrong pad, lower values, tie-class swaps, NaN windows) across fp32/bf16 and randn/equal/two-valued data.
  • tests/unittest/tools/test_unittest_culprits.py (cpu_only): 23 passed, including the new _stage_unittest_markexpr cases.
  • Collection: every PRE_MERGE_CELLS entry names a collected test and every cell matches at least one case.

CI: /bot run --extra-stage "DGX_B200-PyTorch-Post-Merge-1,DGX_B200-PyTorch-Post-Merge-2,DGX_H100-PyTorch-Post-Merge-1,DGX_H100-PyTorch-Post-Merge-2" runs the default pre-merge set plus the post-merge stages that hold the new entries. The multi-GPU stages run once the approval label is on.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

🤖 Generated with Claude Code

test_indexer_topk.py and test_gvr_selfsampling_topk.py cost 689 GPU-weighted
hours of pre-merge test time in the week of 2026-11-09. Keep pre-merge on the
cases that guard production paths and run the rest of each grid post-merge:

- tests/unittest/conftest.py marks the parametrized cases outside a module's
  PRE_MERGE_CELLS with post_merge, and test_unittests.py leaves post_merge
  cases out of every CI stage whose name lacks "Post-Merge".
- Both files declare PRE_MERGE_CELLS: production paths (fp32 scores, K in
  {512, 1024, 2048}) keep covering cells; entry points and dtypes without a
  production caller keep smoke cells.
- The l0_gb300.yml pre-merge kernels/parallel entry ignores both files (B300
  runs the same SM103 kernels); l0_b200.yml post-merge runs their post_merge
  cases.
- The per-row oracles of test_gvr_selfsampling_topk.py become batched tensor
  checks with the same assertions.

Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
@longcheng-nv

Copy link
Copy Markdown
Collaborator Author

/bot run --extra-stage "DGX_B200-PyTorch-Post-Merge-1,DGX_B200-PyTorch-Post-Merge-2"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88457 [ run ] triggered by Bot. Commit: 2ab28fe Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88457 [ run ] completed with state SUCCESS. Commit: 2ab28fe
/LLM/main/L0_MergeRequest_PR pipeline #73458 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Either:

  • Wait for the PR to be fully approved — the label is added automatically once approval is complete. Having unresolved open comments is fine, or
  • If needed, ask a member of NVIDIA/trt-llm-ci-approvers to add the label manually.
    Then re-trigger CI with the same bot command (no rebase needed).

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

@longcheng-nv
longcheng-nv marked this pull request as ready for review December 2, 2026 03:32
@longcheng-nv
longcheng-nv requested review from a team as code owners December 2, 2026 03:32
@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds parameter-based pre-merge selection for Top-K tests, marks other cases for post-merge runs, updates integration-stage test lists, and replaces several per-row GVR self-sampling checks with batched tensor validation.

Changes

Top-K test selection and validation

Layer / File(s) Summary
Pre-merge case selection
tests/unittest/_torch/kernels/parallel/test_indexer_topk.py, tests/unittest/_torch/kernels/parallel/test_gvr_selfsampling_topk.py, tests/unittest/conftest.py
The Top-K modules define pre-merge parameter selections. The collection hook marks cases outside those selections as post_merge.
Batched GVR checks
tests/unittest/_torch/kernels/parallel/test_gvr_selfsampling_topk.py
GVR self-sampling checks use batched tensor operations for uniqueness, bounds, values, variable-length rows, and prefill results.
Integration-stage routing
tests/integration/defs/test_unittests.py, tests/integration/test_lists/test-db/l0_b200.yml, tests/integration/test_lists/test-db/l0_gb300.yml, tests/integration/test_lists/test-db/l0_h100.yml, tests/unittest/tools/test_unittest_culprits.py
The integration helper adds not post_merge for stages without Post-Merge in their name. The B200 list adds both Top-K test files with -m post_merge; the H100 list adds the GVR self-sampling test with -m post_merge; the GB300 parallel-kernel entry excludes the Top-K tests. Tests cover the stage mark-expression helper.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Sequence Diagram(s)

sequenceDiagram
  participant IntegrationStage
  participant test_unittests_v2
  participant pytest
  participant pytest_collection_modifyitems
  IntegrationStage->>test_unittests_v2: supplies stage prefix and mark expression
  test_unittests_v2->>pytest: passes the stage-filtered mark expression
  pytest->>pytest_collection_modifyitems: collects parametrized test items
  pytest_collection_modifyitems->>pytest: marks unselected cases post_merge
Loading

Suggested reviewers: qijune, chzblych

Merge Risk: Minimal · up to a4136 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Architecture risk: Low · up to a4136

The change affects 1 source area.

The collection hook must mark cases outside the pre-merge selection as post_merge so non-Post-Merge stage filtering can exclude them while post-merge runs retain them.

Changed areas: tests

Review details

Systems and components

  • observed — 8 changed files mapped to tests.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: cutting pre-merge CI time for the indexer Top-K unit tests. The changeset does this by marking non-production parametrized cases post_merge via PRE_MERGE_CELLS and rem…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template closely. It has a clear Description section that states the problem (the two files are in the top 1% of pre-merge test time), the solution (PRE_MERGE_CE…
Full details: Title check

Explanation

The title names the main change: cutting pre-merge CI time for the indexer Top-K unit tests. The changeset does this by marking non-production parametrized cases post_merge via PRE_MERGE_CELLS and removing the GB300 pre-merge run. The title follows the required [None][test] format and stays specific.

Full details: Description check

Explanation

The description follows the repository template closely. It has a clear Description section that states the problem (the two files are in the top 1% of pre-merge test time), the solution (PRE_MERGE_CELLS selection with full grids moved to post-merge), and the reasoning behind the cell choices. The Test Coverage section is detailed: it gives CI results, per-stage timing tables, a lab reproduction with before/after numbers, and the validation commands. The checklist is marked. The description does not use the required title format, but titles are outside this check. The description is substantive and specific, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 2ab28fe and a413643.

Files ignored due to path filters: 1

  • tests/integration/defs/agg_unit_mem_df.csv is excluded by !**/*.csv
Files selected for processing: 1

  • tests/integration/test_lists/test-db/l0_h100.yml

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

@yuxianq

yuxianq commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

@heyuhhh, could you help to review this PR as trt-llm-torch-attention-devs? Thanks~

Assignment explanation
Componentsintegration/attention-tests (100%)
Tagsalgorithm:sparse (100%); phase:decode (65%); phase:prefill (35%); features:speculative-decoding (100%); context:llm (100%)
PR effort5 points — Reviewing the selected cases requires mapping K, token count, row count and overflow policy to distinct dispatch paths. The reported GVR oracle rewrite adds a separate correctness question about ties, padding and invalid indices.
Retained GitHub review requestskris1025: preserve other-group coverage: NVIDIA/trt-llm-kernels-devs
Affinity (0–1)0.487 component/tag match
Affinity evidenceMerged authorship 2 × √points; first review 1 × √points; global normalization 0.766368
Outstanding points at selection5 → 10 (+5)
Points already reserved on this PR0
Effective weight0.5
Completed review points (preceding 168 hours)16
Combined points after assignment26
Demand-derived target21.00 points (soft share)
Additional fair share before assignment0.00 points
Share explanationWhole PR / qualification or coverage constraint exceeds a soft share; assignment is allowed.
Selection rulebalance-first maintenance
Assignment scope (heyuhhh)sparse_attention

Affinity and workload are snapshots at selection, not live counters. Existing reservations on this PR are counted once.

@yuxianq
yuxianq requested review from heyuhhh and removed request for QiJune and lfr-0531 December 2, 2026 03:47
@trtllm-agent-review

Copy link
Copy Markdown
Collaborator

Thanks for the PR, @longcheng-nv. @trtllm-agent-review reviews it when it is asked to: once the PR is ready for review, please comment @trtllm-agent-review please help review it. The bot looks for that comment every hour, on the hour, and starts its review then.

test_gvr_selfsampling_topk.py runs in full on SM90: main's H100 pre-merge
stage passes 1,012 of its 1,013 cases. With PRE_MERGE_CELLS, H100 pre-merge
keeps 269 of them, and no H100 post-merge list ran the file, so the other
744 cases stopped running on SM90. Add the file's post_merge cases to the
l0_h100.yml post-merge block, with an agg_unit_mem_df.csv row that uses the
parallel factor of the kernels/parallel row. test_indexer_topk.py needs no
entry: its cases outside the cells skip on SM90.

Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
@longcheng-nv

Copy link
Copy Markdown
Collaborator Author

/bot run --extra-stage "DGX_B200-PyTorch-Post-Merge-1,DGX_B200-PyTorch-Post-Merge-2,DGX_H100-PyTorch-Post-Merge-1,DGX_H100-PyTorch-Post-Merge-2"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88629 [ run ] triggered by Bot. Commit: a413643 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88629 [ run ] completed with state SUCCESS. Commit: a413643
/LLM/main/L0_MergeRequest_PR pipeline #73612 completed with status: 'UNSTABLE'

CI Report

⚠️ Multi-GPU Label Required:
Multi-GPU tests require the ci: full pre-merge approved label on this PR. Either:

  • Wait for the PR to be fully approved — the label is added automatically once approval is complete. Having unresolved open comments is fine, or
  • If needed, ask a member of NVIDIA/trt-llm-ci-approvers to add the label manually.
    Then re-trigger CI with the same bot command (no rebase needed).

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

Link to invocation

batch_size=1, next_n=1, index_topk=2048, num_tokens=131072, dtype=_F16, cluster_size=4
),
],
"test_cute_dsl_topk_decode_high_and_odd_k": [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No pre-merge cell runs top_k=16384. These four cells stop at K=8192, so the regression check inside test_cute_dsl_topk_decode_high_and_odd_k (the batch_size == 1 and index_topk == 16384 and num_tokens == 32768 branch, around line 988) no longer runs pre-merge. That branch is the one that checks a row whose effective length spans more than one chunk but is at most top_k, in a 4-CTA radix-filter cluster.

This is a production path: TriAttention allows budgets up to 16384 (triattention.py:124, "must be at most 16384 for the Blackwell TopK selector") and selects with TopKImplementation.CUTE_DSL_RADIX. A change that breaks that case would pass every pre-merge stage and only show up post-merge.

Suggested: add dict(batch_size=1, index_topk=16384, num_tokens=32768) to this function's cells.

dict(overflow_policy="REREAD", batch_size=4, top_k=512, dtype=_F32),
],
# The prefill kernel uses every overflow policy: each one in fp32, plus a bf16 cell
"test_prefill_overflow_policy_overflow": [

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fp32 REREAD is pre-merge only at K=2048. cute_dsl_indexer_topk_prefill_blackwell defaults to overflow_policy="REREAD", and the production callers don't pass a policy. With these cells, K=512 runs only GMEM_SPILL (fp32) and REREAD in bf16, and K=1024 only TRUNCATE. The other CuTe DSL prefill tests stop at num_tokens=8192, the fp32 SMEM input size, so they never reach the reread fallback either.

That fallback at K=512 is the path CSA2's prefill (index_topk 512) takes on long context chunks with more than 8192 columns, so a regression there would pass pre-merge. The comment above ("The prefill kernel uses every overflow policy") also reads as if each K were covered.

Suggested: add fp32 REREAD cells for top_k 512 and 1024 (or move REREAD onto those K), and reword the comment to say which K each policy runs at.

@yuxianq

yuxianq commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

@kris1025, thanks for picking up this PR! I’ve handed off the trt-llm-torch-attention-devs review from @heyuhhh to you.

@heyuhhh’s unfinished attention reservation has been released. @kris1025’s review is assessed at 5 points. Any completed review credit from earlier rounds is preserved. Each reviewer’s work is counted once per review round.

@heyuhhh, no further attention review is requested from you. Thanks~

@yuxianq
yuxianq requested review from kris1025 and removed request for heyuhhh December 3, 2026 10:45
@longcheng-nv

Copy link
Copy Markdown
Collaborator Author

/bot run --extra-stage "DGX_B200-PyTorch-Post-Merge-1,DGX_B200-PyTorch-Post-Merge-2,DGX_H100-PyTorch-Post-Merge-1,DGX_H100-PyTorch-Post-Merge-2"

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88932 [ run ] triggered by Bot. Commit: a413643 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #88932 [ run ] completed with state SUCCESS. Commit: a413643
/LLM/main/L0_MergeRequest_PR pipeline #73883 completed with status: 'SUCCESS'

CI Report

Link to invocation

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants